home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Mac Format 1995 June
/
MacFormat 25.iso
/
Shareware City
/
Developers
/
fortran-to-c-translator-11
/
Mac F2C 1.1
/
CodeWarrior Specific Stuff
/
MPW⁄Toolserver Tools
/
Toolserver READ ME
< prev
Wrap
Text File
|
1995-01-02
|
3KB
|
104 lines
USING MPW TOOLS WITH CODEWARRIOR AND MAC F2C
The folder "F2C MPW Tools" contains three MPW tools: F2CMake, CWMake and
CWOpen.
Metrowerks CodeWarrior comes with the complete MPW environment and with
Toolserver, a program that lets you execute MPW tools and scripts.
If you start Toolserver from the CW environment, you get a text shell
window where you can type commands. Please refer to the Toolserver
documentation on the CW CD for more information.
F2CMake accepts a command line string containing Unix style options and
one or more filenames to send them in a "kAEf2cEvent" AppleEvent to
Mac F2C which will translate the file(s). If Mac F2C is not currently
running, F2CMake will try to launch it.
CWMake simply sends a "Make" event to the CW C enviroment that is
currently running (68K or PPC version).
CWOpen sends an 'Open' AppleEvent to the CW PPC or 68K C compiler,
whichever is currently running. The command line should contain the
name(s) of the file(s) to open.
With the help of these tools you can automate the building process
of Fortran programs. You can edit your Fortran files and just execute
a Makefile which scans all the files belonging to a project, tells
Mac F2C to translate the ones that have to and tells CW to build the
program. CWOpen is not needed in this progress, but it is useful if
you would like to open, say, all the .e files that Mac F2C produces
(Just type "CWOpen ≈.e" in the Toolserver shell window).
INSTALLATION
- Copy F2CMake, CWMake and CWOpen into the "Tools" folder
that Toolserver uses
- Copy "Make" from the MPW distribution into the same folder
- Copy the MPW script "BuildProgram" into the "Scripts"
folder of Toolserver
- Make sure the "After Producing a valid C File, Inform..."
options in the Mac F2C Preferences dialog are unchecked.
USAGE
First Build:
- Use Mac F2C manually to translate your Fortran source
into C.
- Add the resulting C sources to the "Empty" project and let
CW make the program.
- Enter a Makefile like this one in a new editor window:
OBJECTS = prog1.c ∂
prog2.c ∂
prog3.c ∂
prog4.c
Basistest ƒƒ {OBJECTS}
CWMake
.c ƒ .f
F2CMake -f -!i8 -A -a -E -ec -R -w66 {Default}.f
The source file names (prog1.c, prog2.c,...) as well as the
F2C options are just examples.
- Save the Makefile under the name "Makefile" into your
project folder.
Subsequent Builds:
- Start Toolserver.
- Use the "Directory" command to move to your project folder.
- Edit your Fortran source files.
- Type "BuildProgram <name>", where <name> is the name of the
program as given in the CW Preferences of your project.
The commands needed to update the project are executed and
written to the shell window. Mac F2C runs faster if you bring
it to the foreground.
If you don't like to type long command names (like me), include a
few alias entries in your "UserStartupTS" file, e.g.
Alias cd Directory
Alias touch setfile -m .
Alias edit CWOpen
Alias pmake BuildProgram
You can even include a "Directory <whereYourProjectsAre>" command
here so you don't have to type the pathname all the time.